package br.com.playonline.persisitencia;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

public class FabricaCon {

	private static FabricaCon INTANCE = new FabricaCon();

	private FabricaCon() {
	}

	public static FabricaCon getInstance() {
		return INTANCE;
	}

	public Connection getConnection(){
		Connection connection = null;
		try {
			Class.forName("com.mysql.jdbc.Driver");
			String url = "jdbc:mysql://localhost/playonline"; 
			connection = DriverManager.getConnection(url,"root","admin");
		} catch (ClassNotFoundException e) {
			e.printStackTrace();
		} catch (SQLException e) {
			e.printStackTrace();
		}
		return connection;
	}
}
